/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cms.dataaccess;

/**
 *
 * @author Timmy
 */
public abstract class DAOFactory {
     public abstract ConferenceDAO getConferenceDAO();
    public abstract ConferenceItemDAO getConferenceItemDAO();
    public abstract ConferenceItemOrderDAO  getConferenceItemOrderDAO();
    public abstract ItemAuthorsDAO  getItemAuthorsDAO();
    public abstract ParticipantDAO  getParticipantDAO(); 
    public abstract ProfileDAO      getProfileDAO(); 
    public abstract UserDAO         getUserDAO();   
    public abstract TimeLineDAO      getTimeLineDAO(); 
    public abstract PaymentDAO       getPaymentDAO();
    
    public abstract ReviewContentsDAO  getObjectiveItemDAO();
    public abstract ReviewRateDAO  getObjectiveRateDAO();
    public abstract ReviewCategoryDAO getReviewCategoryDAO();
    public abstract ReviewDeailsDAO   getReviewDetailsDAO();
    public abstract ReviewLogDAO       getReviewLogDAO();
    public abstract ReviewContentsDAO   getReviewContentsDAO();
    //-----------------------------------------------------------//
  
    private static DAOFactory instance;
    public static int accessConfig = 1; // by default access DB
  
   
   public static DAOFactory getInstance() {
        instance = loadInstance(accessConfig);      
        return instance;
    }
   
   public static DAOFactory getInstance(int i)
   {
       instance = loadInstance(i);
       return instance; 
   }
   
    private static DAOFactory loadInstance(int accessConfig) {
        switch (accessConfig)
        {
            case 1 : 
                return new cms.dataaccess.hibernate.DAOFactoryImpl();
            default:
                 throw new UnsupportedOperationException("Not yet implemented");
        }
    }
}
